package com.zzld.modules.autoinn.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zzld.core.service.BaseServiceImpl;
import com.zzld.modules.autoinn.entity.Expense;
import com.zzld.modules.autoinn.mapper.ExpenseMapper;
import com.zzld.modules.autoinn.service.IExpenseService;

@Service("expenseService")
public class ExpenseServiceImpl extends BaseServiceImpl<Expense> implements IExpenseService {
	
	@Autowired
	private ExpenseMapper expenseMapper;
	
	public PageInfo list(Map map,int pageNum,int pageSize){
		Map<String,Object> maps = map;
		
		PageHelper.startPage(pageNum, pageSize);
		List<Expense> list = expenseMapper.selectpage(maps);
		
		PageInfo page = new PageInfo(list);
		return page;
	}
	
	
	public List<Expense> selectall(Map map){
		 try{
			 return expenseMapper.selectpage(map);
		 }catch(Exception e){
			 e.printStackTrace();
		 }
		 return null;
	}
	
	public Integer saveexpense(Expense e){
		return expenseMapper.saveexpense(e);
	}
	
	public Expense selectbyproid(Map<String,Object> map){
		try{
			return expenseMapper.selectbyproid(map);
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
	
	public Integer selectbycount(String customerid){
		return selectbycount(customerid);
	}
	
	public List<Expense> selectbydinglist(Map<String,Object> map){
		try{
			return expenseMapper.selectbydinglist(map);
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
	
	
	public Integer selectbystorecount(String storeid){
		try{
			return expenseMapper.selectbystorecount(storeid);
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}


	@Override
	public String selectbyprice(String price) {
		// TODO 自动生成的方法存根
		try{
			return expenseMapper.selectbyprice(price);
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}


	@Override
	public String selectbyyfprice() {
		// TODO 自动生成的方法存根
		try{
			return expenseMapper.selectbyyfprice();
		}
		catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
	

	
	

}
